import { $http } from './index';

// 获取电梯的点位信息
export function queryInnerPointByEleId(params: Object) {
    return $http.get('/saas/point/queryInnerPointByEleId', { params });
}
// 获取电梯的点位信息
export function queryOutPointByEleId(params: Object) {
    return $http.get('/saas/point/queryOutPointByEleId', { params });
}

export function queryInnerBoxByEleId(params: Object) {
    return $http.get('/saas/box/queryInnerBoxByEleId', { params });
}
export function queryOutBoxByEleId(params: Object) {
    return $http.get('/saas/box/queryOutBoxByEleId', { params });
}


export function queryOutPointByFloorId(params: Object) {
    return $http.get('/saas/point/queryOutPointByFloorId', { params });
}

export function queryOutBoxByFloorId(params: Object) {
    return $http.get('/saas/box/queryOutBoxByFloorId', { params });
}
export function queryBarrierMediaByGatewayId(params: Object) {
    return $http.get('/saas/gatewayMedia/queryBarrierMediaByGatewayId', { params });
}
export function queryGatewayMediaByGatewayId(params: Object) {
    return $http.get('/saas/gatewayMedia/queryGatewayMediaByGatewayId', { params });
}

// 新建点位信息
export function addBarrierMedia(data = {}) {
    // 新建道闸点位
    return $http.post('/saas/gatewayMedia/addBarrierMedia', data);
}
export function addGattingMedia(data = {}) {
    // 新建门禁点位
    return $http.post('/saas/gatewayMedia/addGattingMedia', data);
}
export function addInnerPoint(data = {}) {
    // 新建梯内屏点位
    return $http.post('/saas/point/addInnerPoint', data);
}
export function addOutPoint(data = {}) {
    // 新建梯外屏点位
    return $http.post('/saas/point/addOutPoint', data);
}
export function addInnerBox(data = {}) {
    // 新建梯内框点位
    return $http.post('/saas/box/addInnerBox', data);
}
export function addOutBox(data = {}) {
    // 新建梯外框点位
    return $http.post('/saas/box/addOutBox', data);
}

// 编辑点位信息
export function updateBarrierMedia(data = {}) {
    return $http.post('/saas/gatewayMedia/updateBarrierMedia', data);
}
export function updateGattingMedia(data = {}) {
    return $http.post('/saas/gatewayMedia/updateGattingMedia', data);
}
export function updateInnerPoint(data = {}) {
    return $http.post('/saas/point/updateInnerPoint', data);
}
export function updateInnerBox(data = {}) {
    return $http.post('/saas/box/updateInnerBox', data);
}
export function updateOutPoint(data = {}) {
    return $http.post('/saas/point/updateOutPoint', data);
}
export function updateOutBox(data = {}) {
    return $http.post('/saas/box/updateOutBox', data);
}
export function elevatorQueryById(id = '') {
    return $http.get(`/saas/elevator/queryById?elevatorId=${id}`);
}
export function floorQueryById(id = '') {
    return $http.get(`/saas/floor/queryById?floorId=${id}`);
}
export function gatewayQueryById(id = '') {
    return $http.get(`/saas/gateway/queryById?gatewayId=${id}`);
}

// V2.1.2_点位查询方案排斥 新接口
// 查询空位
export function searchEmptyExport(data = {}) {
    return $http.post('/saas/order/point/empty/export', data);
}

// 上传空位文件解析
export function uploadPointFile(data = {}) {
    return $http.post('/saas/order/point/coordinate/upload', data);
}

// 获取未排斥方案列表
export function getIncludeProject(data = {}) {
    return $http.post('/saas/order/plan/exclude/not', data);
}

// 保存方案排斥
export function saveExcludeProject(data = {}) {
    return $http.post('/saas/order/plan/exclude/save', data);
}

// 批量导出点位
export function batchExportPoint(data = {}) {
    return $http.post('/saas/order/point/export/batch', data);
}

// 导出数字刊播报告
export function exportKanBoReport(data = {}) {
    return $http.post('/saas/order/exportPublishReport', data);
}

// 导出刊播照片
export function exportPublishPhoto(data = {}) {
    return $http.post('/saas/order/exportPublishPhoto', data);
}

export function exportRealPointExcel(data = {}) {
    return $http.post('/saas/order/exportPublishPoint', data);
}

// 获取已排斥方案列表
export function getExcludeProject(data = {}) {
    return $http.post('/saas/order/plan/excluded', data);
}

export function queryPremisesContracts(data = {}) {
    return $http.get(`/saas/premisesContract/queryPremisesContracts/${data.premiseId}/${data.terminalType}`);
}
